#include <QApplication>
#include <QFile>
#include "my_gtc_dialog.h"
#include "mb_webview.h"

int main(int argc, char *argv[])
{
#if 1
    QApplication app(argc, argv);    
    app.setGraphicsSystem("raster");    /*native,raster or opengl*/

    QSplashScreen *splash = new QSplashScreen;  
    splash->setPixmap(QPixmap(":/image/splash.jpg"));    
    splash->show();
    Qt::Alignment splash_txt = Qt::AlignCenter | Qt::AlignBottom;
    splash->showMessage(QObject::tr("loading.."), splash_txt, Qt::white);
    
    app.setApplicationName("iPhone;CPU like Mac OS X");
    app.setApplicationVersion("Version/3.0 Mobile/4A93 Safari/525.13");
    my_gtc_dialog *dialog = new my_gtc_dialog;    
#ifdef WINCE    
    dialog->showFullScreen();
#else
    dialog->show();
#endif

#if 0
    QUiLoader uiNew;
    QFile file(":/ui/test_dlg.ui");
    QWidget *newDlg = uiNew.load(&file);
    if(newDlg)
    {
        newDlg->show();
        QPushButton *d_btn = newDlg->findChild<QPushButton *>("d_btn");
        newDlg->connect(d_btn, SIGNAL(clicked()), dialog, SLOT(accept()));
    }
#endif
    splash->finish(dialog->www);
    delete splash;
    return app.exec();
#else
    /*testing webkit without QWidget*/
    QApplication app(argc, argv);
    mb_webview my_view(QUrl("http://www.baidu.com"));

    return app.exec();
#endif
}
